﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;


namespace InvasionWars
{
    [Serializable]
    public class GameSession
    {

        public TcpListener Listener{get; set;}

        public string Host
        {
            get
            {
                return host;
            }
        }
        private string host;

        public int GameID
        {
            get
            {
                return gameID;
            }

        }
        private int gameID;

        public bool IsFull
        {
            get
            {
                return isFull;
            }
        }
        private bool isFull;

        public void SetFull()
        {
            isFull = true;
        }


        public GameSession()
        {
        }

        public GameSession(int id, string nHost, bool isGameFull)
        {
            isFull = isGameFull;
            host = nHost;
            gameID = id;
        }

        public GameSession(int id, string nHost, bool isGameFull, TcpListener player)
        {
            isFull = isGameFull;
            host = nHost;
            gameID = id;
            Listener = player;
        }


        public override string ToString()
        {
            if (IsFull)
            {
                return Host + " : " + GameID + ": Full";
            }
            else
            {
                return Host + " : " + GameID;
            }
        }
    }
}
